﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model;
using HengTong.Model.Db.Hr;


namespace HengTong.ViewModel.Person.SysPersonContractVms
{
    public partial class SysPersonContractTemplateVm : BaseTemplateVM
    {
        [Display(Name = "员工")]
        public ExcelPropety PersonExcel = ExcelPropety.CreateProperty<SysPersonContract>(x => x.PersonId);
        [Display(Name = "用工形式")]
        public ExcelPropety EmploymentTypeExcel = ExcelPropety.CreateProperty<SysPersonContract>(x => x.EmploymentType);
        [Display(Name = "合同类型")]
        public ExcelPropety ContractTypeExcel = ExcelPropety.CreateProperty<SysPersonContract>(x => x.ContractType);
        [Display(Name = "合同编号")]
        public ExcelPropety ContractNoExcel = ExcelPropety.CreateProperty<SysPersonContract>(x => x.ContractNo);
        [Display(Name = "签订日期")]
        public ExcelPropety SignDateExcel = ExcelPropety.CreateProperty<SysPersonContract>(x => x.SignDate);
        [Display(Name = "到期日期")]
        public ExcelPropety ExpireDateExcel = ExcelPropety.CreateProperty<SysPersonContract>(x => x.ExpireDate);
        [Display(Name = "合同次数")]
        public ExcelPropety ContractCountExcel = ExcelPropety.CreateProperty<SysPersonContract>(x => x.ContractCount);

	    protected override void InitVM()
        {
            PersonExcel.DataType = ColumnDataType.ComboBox;
            PersonExcel.ListItems = DC.Set<SysPerson>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysPersonContractImportVm : BaseImportVM<SysPersonContractTemplateVm, SysPersonContract>
    {

    }

}
